<?xml version="1.0" encoding="utf-8"?>
<taskrunner name="doinstall" version="1.1" date="2013-05-20" maxthreads="1">


  <!--
    2008-10-30/MMA  Redesign.
    2008-11-05/MMA  task "copy.unistall" is now in a separate file: vida.copy.uninstall.xml.
    2009-03-17/MMA  task "desktop.shortcuts" will no longer be run if main.install.type="REINSTALL"
    2009-06-09/MMA  task Refresh.Desktop added. Problems with the iconcache.db on Vista.
    QC10265 : 2011-08-04 : teriks28
          Removed webex
		2012-01-26: teriks28: QC10040 "IE9 - When Query Order is pressed IE9 stop responding"
					Added task "Add.InternetExplorer.registry.key" that runs a reg file that ads key "DetourDialogs" to "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows"
    2013-05-20  : teriks28 : OGB Project
          Removed condition on task "eswdl". OGB project decided that eSWDL should not be delivered together with VIDA, but we need to have the search path for the eswdl directory 
          in the session database.
          Removed this condition "${request.eswdl}=true" on task "eswdl" so that it allways runs.
          Removed input parameter "request.eswdl"
    2013-10-24 : teriks28 : ALM REQ 4391 Diagnostics and Software manager will not work if Microsoft .Net 4.5 is installed
           Added two new tasks for adding registry key for "EnableIEHosting" :  "Add.EnableIEHosting.x64.registry.key" and "Add.EnableIEHosting.x86.registry.key"         
  -->

  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <parameters>
    <parameter name="is.vow" value="input#"/>
    <parameter name="request.sqlexpress" value="input#"/>
    <parameter name="request.dice" value="input#"/>
    <parameter name="request.adobereader" value="input#"/>
    <parameter name="request.isoview" value="input#"/>    
    <parameter name="request.x64" value="input#"/>
  </parameters>
  
  
  <tasks>
 
    <task name="set.install.type">
      <description>
        Sets the global property install.type to INSTALL.
      </description>
      
      <subtasks filename="vida.setinstalltype.xml">
        <parameters>
          <parameter name="install.type" value="INSTALL"/>
        </parameters>
      </subtasks>
    </task>

    <task name="3pp.components">
      <description>
        Installs and configures 3PP softwares.
      </description>
      <dependencies list="set.install.type"/>
      <subtasks filename="vida.3pp.components.xml">
        <parameters>
          <parameter name="is.vow" value="${is.vow}"/>
          <parameter name="request.sqlexpress" value="${request.sqlexpress}"/>
          <parameter name="request.dice" value="${request.dice}"/>
          <parameter name="request.adobereader" value="${request.adobereader}"/>
          <parameter name="request.isoview" value="${request.isoview}"/>	        
          <parameter name="request.x64" value="${request.x64}"/>
        </parameters>
      </subtasks>
    </task>

    <task name="check.installed.version">
      <description>
        Checks previous version.
        Uses the global variable - ¤{installed.version} - to store installed version.
      </description>
      <dependencies list="3pp.components,set.install.type"/>
      <subtasks filename="vida.check.installed.version.xml"/>
    </task>   
   
    <task name="vida">
      <description>
        Installs appserver and vida application files.
      </description>
      <dependencies list="Write,check.installed.version"/>
      <subtasks filename="vida.install.vida.xml">
        <parameters>          
          <parameter name="request.x64" value="${request.x64}"/>
        </parameters>
      </subtasks>
    </task>

    <task name="databases">
      <description>
        Installs vida databases.
      </description>
      <dependencies list="vida,3pp.components"/>
      <subtasks filename="vida.install.databases.xml"/>
    </task>

    <task name="desktop.shortcuts" critical="false">
      <description>
        Creates icons on the desktop and a Vida folder in the start menu.
        OBSOLETE -> This task will not be run if main.install.type = REINSTALL
        NEW -> This task will be run even if the main.install.type is set to REINSTALL
      </description>
      <dependencies list="vida,databases[requireSuccess=false]"/>
      <subtasks filename="vida.install.desktop.shortcuts.xml"/>
    </task>

    <task name="autostart.items">
      <description>
        Programs that should run when Windows starts up is added to the
        registry.
      </description>
      <dependencies list="vida,desktop.shortcuts[requireSuccess=false]"/>
      <subtasks filename="vida.autostart.xml"/>
    </task>

    <task name="add.accesscontrol.to.install.root">
      <description>
        Adds FullControl permission to the Vida install folder
        and it's subfolders to all users.
      </description>
      <dependencies list="autostart.items[requireSuccess=false]"/>
      <subtasks filename="vida.accesscontrol.xml">
        <parameters>
          <parameter name="fullpath" value="${target.root}"/>
        </parameters>
      </subtasks>
    </task>

    <task name="copy.uninstall">
      <description>
        Copies all files that will be neccessary to use during an uninstall of Vida.
      </description>
      <dependencies list="add.accesscontrol.to.install.root[requireSuccess=false]"/>
      <subtasks filename="vida.copy.uninstall.xml"/>
    </task>

    <task name="remove.readonly.attribute" critical="false" typename="@CommandLine">

      <description>
        removes the attribute read-only on all files in ${target.db.update.dir}
      </description>
      <dependencies list="copy.uninstall"/>
      <parameters>
        <parameter name="arguments" value="attrib -R /S /D"/>
        <parameter name="workingdirectory" value="${target.root}"/>
        <parameter name="useCmdExe" value="true"/>
      </parameters>
    </task>

    <task name="config">
      <description>
        Configures the vida environment.
      </description>
      <dependencies list="vida,databases,desktop.shortcuts[requireSuccess=false],copy.uninstall"/>
      <subtasks filename="vida.config.xml"/>
    </task>

    <task name="eswdl">
      <dependencies list="config"/>
      <subtasks filename="eswdl.install.xml"/>
    </task>

		<task name="Add.InternetExplorer.registry.key" condition="${windows.version.name}!=Windows XP" typename="@RegistryRestore">
			<description>
				Adds the key DetourDialogs to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows
			</description>
			<dependencies list="eswdl"/>
			<parameters>
				<parameter name="registry.file.fullpath" value="${install.src.install.utils.dir}\DetourDialogs_Fix_IE9.reg"/>
			</parameters>
		</task>

    <!--Just for x64 Windows 7 operating systems-->
    <task name="Add.EnableIEHosting.x64.registry.key" condition="${windows.version.name}!=Windows XP AND ${request.x64}=true" typename="@RegistryRestore">
      <description>
        Adds the key DetourDialogs to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MICROSOFT\.NETFramework
      </description>
      <dependencies list="eswdl"/>
      <parameters>
        <parameter name="registry.file.fullpath" value="${install.src.install.utils.dir}\EnableIEHostingx64.reg"/>
      </parameters>
    </task>

    <!--Just for x86 Windows 7 operating systems-->
    <task name="Add.EnableIEHosting.x86.registry.key" condition="${windows.version.name}!=Windows XP AND ${request.x64}=false" typename="@RegistryRestore">
      <description>
        Adds the key DetourDialogs to HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\.NETFramework
      </description>
      <dependencies list="eswdl"/>
      <parameters>
        <parameter name="registry.file.fullpath" value="${install.src.install.utils.dir}\EnableIEHostingx86.reg"/>
      </parameters>
    </task>


  </tasks>

</taskrunner>